package com.ruoyi.system.api;

import java.util.List;

import com.ruoyi.system.api.domain.SysDictData;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.SysDictType;
import com.ruoyi.system.api.factory.RemoteSysDictTypeFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;


/**
 * 字典类型微服务接口
 * 
 * @author ruoyi
 * @date 2023-04-27
 */
@FeignClient(contextId = "remoteSysDictTypeService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteSysDictTypeFallbackFactory.class)
public interface RemoteSysDictTypeService
{
    /**
     * 查询字典类型
     * 
     * @param dictId 字典类型主键
     * @return 字典类型
     */
    @GetMapping("/inner/dicttype/{dictId}")
    public R<SysDictType> selectSysDictTypeByDictId(@PathVariable("dictId") Long dictId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 查询字典类型列表
     * 
     * @param sysDictType 字典类型
     * @return 字典类型集合
     */
    @PostMapping("/inner/dicttype/list")
    public R<List<SysDictType>> selectSysDictTypeList(SysDictType sysDictType, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 新增字典类型
     * 
     * @param sysDictType 字典类型
     * @return 结果
     */
    @PostMapping("/inner/dicttype")
    public R<Integer> insertSysDictType(@RequestBody SysDictType sysDictType, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 修改字典类型
     * 
     * @param sysDictType 字典类型
     * @return 结果
     */
    @PutMapping("/inner/dicttype")
    public R<Integer> updateSysDictType(@RequestBody SysDictType sysDictType, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 批量删除字典类型
     * 
     * @param dictIds 需要删除的字典类型主键集合
     * @return 结果
     */
    @DeleteMapping("/inner/dicttype/{dictIds}")
    public R<Integer> deleteSysDictTypeByDictIds(@PathVariable("dictIds") Long[] dictIds, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/inner/dicttype/data")
    R<List<SysDictData>> selectDictDataByType(String dictType, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/inner/dicttype/type")
    R<SysDictType> selectDictTypeByType(String dictType, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
